var required = require('../plugs/guimain/required')
var authToken = require('../funcs/authTimeOut')
var mongoFunc = require('../funcs/mongoFunc')
var send = require('../funcs/sendData')
var mongodb = require('../plugs/mongose/mongoQuery')
var result = app => {
	var isEmptyStr = required.isEmptyStr
	var isRange = required.isRange
	var isEmptyObject = required.isEmptyObject
	// addCode
			// B1MADZTNB Start
			

app.post('/test3/add',authToken,(req, res) => { // test3-新增
    
  var params = req.body
  var name = params.name // 添加测试
  var age = params.age // 年龄
    
  var where = {name,age}
    
    
    where.createTime = new Date()
    where.updateTime = new Date()
    
        where.userId = req.userId
    
    
  mongodb.save('test3', where,function(err, data) {
    if(err) {
      console.log(err)
      send(res, false)
    } else {
      
      send(res, true, data)
    }
    return
  })
    
    
})
			// B1MADZTNB end
			
}
module.exports = result
